package com.example.intelligentattendancesystem.pojo;

import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Objects;

/**
 * 记录迟到信息的普通实体类
 * @author
 * @version 1.0
 * @className Late
 * @since 1.0
 */
@Component
public class Late {
//    id        int auto_increment primary key,
//    user_id   int,
//    late_time DateTime,
    private Integer id;
    private int userId;
    private String lateTime;

    public Late() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Late late = (Late) o;
        return userId == late.userId && Objects.equals(id, late.id) && Objects.equals(lateTime, late.lateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, lateTime);
    }

    public Late(Integer id, int userId, String lateTime) {
        this.id = id;
        this.userId = userId;
        this.lateTime = lateTime;
    }

    @Override
    public String toString() {
        return "Late{" +
                "id=" + id +
                ", userId=" + userId +
                ", lateTime=" + lateTime +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getLateTime() {
        return lateTime;
    }

    public void setLateTime(String lateTime) {
        this.lateTime = lateTime;
    }
}
